<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateTableArticleRecommend extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('article_recommend', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('type')->default(0)->comment('分类类型 0 首页推荐配置 1 专题推荐配置');
            $table->unsignedBigInteger('articleId')->default(0)->comment('关联文章Id');
            $table->string('title')->default('')->comment('推荐标题');

            $table->unsignedInteger('isActivate')->default(1)->comment('是否激活 0否 1激活');
            $table->unsignedInteger('startAt')->default(0)->comment('开始时间');
            $table->unsignedInteger('endAt')->default(0)->comment('结束时间');
            $table->string('description')->default('')->comment('描述');
            $table->string('cover')->default('')->comment('封面');
            $table->unsignedInteger('sort')->default(100)->comment('排序');

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->tinyInteger('isDeleted')->default(0)->comment('');

            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = '文章_推荐栏目';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('article_recommend');
    }
}
